1. Field of the Invention
The invention relates generally to information signal processing, and more particularly relates to digital compression of color images for storage of the images in a smart card containing a programmable microchip having a memory for storing a color identification photograph.
2. Description of Related Art
One technique that has been used in digital encoding of image information is known as run length encoding. In this technique, the scan lines of a video image are encoded as a value or set of values of the color content of a series of pixels along with the length of the sequence of pixels having that value, set of values, or range of values. The values may be a measure of the amplitude of the video image signal, or other properties, such as luminance or chrominance. Statistical encoding of frequent color values can also be used to reduce the number of bits required to digitally encode the color image data.
One basic encoding process is based upon the block truncation coding (BTC) algorithm published by Mitchell and Delp of Purdue University in 1979. The basic BTC algorithm breaks an image into 4.times.4 blocks of pixels and calculates the first and second sample moments. Based upon an initial quantizer, set to the first sample moment (the arithmetic mean), a selection map of those pixels lighter or darker than the quantizer is determined, along with a count of the lighter pixels. From the first and second sample moments, the sample variance, and therefore, the standard deviation, can be calculated. The mean, standard deviation, and selection map are preserved for each block. However, the original BTC method is limited to a grayscale, so that it would be desirable to adapt the BTC method to extend the BTC method to include YCrCb full-color. It would also be desirable to adapt the BTC method to handle delta values, allowing multi-level, or hierarchical, encoding and allowing encoding of differences between frames or from a specified background color.
The range of color values for any given pixel in a color image can be described, for example, as RGB color space, illustrated in FIG. 1, that can be represented by a conventional three-dimensional Cartesian coordinate system, with each axis representing 0 to 100% of the red, green and blue values for the color value of the pixel. A grayscale line can be described as running diagonally from black at 0% of each component to white at 100% of each. Since human vision can only discriminate a limited number of shades of color values, by selecting representative color values in such a color space, a limited number of color values can be used to approximate the actual color values of an image such that the human eye can not differentiate between the actual color values and the selected color values.
As is illustrated in FIGS. 2 and 3, human vision can be characterized by the Hue-Value-Saturation (HVS) color system. Hue is defined as the particular color in the visible spectrum ranging from red through green and blue to violet. Value is defined as the brightness level, ignoring color. Saturation is defined as the intensity of the particular color or the absence of other shades in the mixture. The HVS system can be represented by a generally cylindrical coordinate system with a polar base consisting of hue as the angle, and saturation as the radius. The value or brightness component is represented as the altitude above the base. The actual visible colors do not occupy the entire cylinder, but are approximately two cones, base to base with their vertices at 0% up to 100% on the value scale. The base is tilted in this example because the maximum saturation for blue occurs at a much lower brightness than the maximum saturation of green.
Referring to FIG. 2, in order to represent digitized NTSC/PAL video in a Cartesian coordinate system, the YCrCb color space is used. Because the smart card system of the invention operates in the YCrCb color space, the smart card system provides for a novel color space conversion from 15- or 24-bit RGB. Eight-bit grayscale images are also supported. Referring also to FIG. 3, the chrominance components, Cr and Cb, are two axes that correspond to the polar hue and saturation components in the HVS system. The Y, or luminance, component corresponds to the brightness axis in the HVS graph. This description does not account for the slight differences between YIQ and YUV for NTSC- and PAL-based encoding, which does not form a part of the invention. The following equations can be used to convert from RGB to the YCrCb color space: EQU Y=0.299R+0.587G+0.114B EQU Cr=0.713 (0.701R-0.587G+0.114B) EQU Cb=0.564 (-0.299R-0.587G+0.866B)
Typical implementations of digitally representing color values in this fashion use floating point arithmetic (11 multiplications and 9 additions/subtractions per pixel) or 16-bit integer arithmetic (9 multiplications, 9 additions/subtractions and 3 division per pixel). Both of these methods are quite wasteful of computing power, particularly on smaller microcontrollers. There is thus a need for a system for representing color values of digitized images that takes advantage of the limitations of human vision in discriminating color in color images in order to reduce the software and hardware requirements, particularly for storage of such color images in smart cards and databases. Smart cards are commonly approximately the same shape and size of a common credit card, and typically contain a programmable microchip, having a memory such as a read only memory, or a read/write memory. Information stored in the memory of the card can be detected by a card interface device such as a card reader or connector.
Unfortunately, noise can seriously interfere with the efficiency of any image compression process, lossy or lossless, because a compression engine must use more unnecessary data to encode noise as if it were actual subject material. Since lossy compression tends to amplify noise creating more noticeable artifacts upon decompression, lossy compression processes therefore typically attempt to remove some of the noise prior to compressing the data. Such preprocessing filters must be used very carefully, because too little filtering will not have the desired result of improved compression performance, and too much filtering will make the decompressed image cartoon-like.
Another technique used for removing unwanted noise from color image data is chromakeying, which is a process of replacing a uniform color background (usually blue) from behind a subject. A common application of this process is a television weather reporter who appears to be standing in front of a map. In actuality, the reporter is standing in front of a blue wall while a computer generated map is replacing all of the blue pixels in the image being broadcast.
While preprocessing filters can remove noise from the area surrounding a subject of interest in an image, subtle changes in lighting or shading can remain in the original image which can be eliminated by chromakeying. There is thus a need to provide a chromakey system in compression of color images for storage on smart cards and databases, in order to replace the background with a solid color to increase the visual quality of the compressed image. It would also be desirable to automate and simplify the chromakey process, to simplify the chromakey process for the operator.
The present invention meets these and other needs.